package com.example.shushiyunsst.fragment.main.mine.child

import android.os.Bundle
import android.view.View
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentStatePagerAdapter
import com.alibaba.android.arouter.facade.annotation.Route
import com.example.library_common.base.BaseDataBindingFragment
import com.example.library_common.base.BaseFragmentEx
import com.example.shushiyunsst.R
import com.example.shushiyunsst.databinding.SecureCenterFragmentBinding
import com.example.shushiyunsst.fragment.signOut
import com.example.shushiyunsst.util.SECURE_CENTER

/**
 * 安全中心
 * */
@Route(path = SECURE_CENTER)
class SecureCenterFragment : BaseDataBindingFragment<SecureCenterFragmentBinding>(),
    View.OnClickListener {


    override fun layoutId(): Int {
        return R.layout.secure_center_fragment
    }


    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        val mToolbar: Toolbar = view.findViewById(R.id.mToolbar)
        mToolbar.title = "安全中心"
        mToolbar.setNavigationOnClickListener { onBackPressedSupport() }
        viewBinder.onViewClick = this

    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.reSettingPassword -> {
                start(ReSettingPassWordFragment.newInstance())
            }
            R.id.aboutUs -> {
                start(AboutUsFragment.newInstance())
            }
            R.id.sign_out -> {
                signOut()
            }
        }
    }

}